package com.starleague.battletech.hexagonal.jpa.appengine;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

import com.starleague.battletech.hexagonal.IBattletechHexGrid;
import com.starleague.hexagonal.HexException;
import com.starleague.hexagonal.flat.jpa.appengine.FlatHexGridGae;

@Entity(name = "BATTLETECH_HEX_GRID")
// @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class BattletechHexGridGae
        extends FlatHexGridGae<BattletechHexGae>
        implements IBattletechHexGrid<BattletechHexGae>
{
    @OneToMany(mappedBy = "hexGrid", cascade = CascadeType.ALL)
    private List<BattletechHexGae> hexList = new ArrayList<>();

    public BattletechHexGridGae(int minGridX,
                                int minGridY,
                                int numHexesX,
                                int numHexesY) throws HexException
    {
        super(minGridX, minGridY, numHexesX, numHexesY);
    }

    public BattletechHexGridGae()
    {
        //
    }

    @Override
    public List<BattletechHexGae> getHexList()
    {
        return this.hexList;
    }
}
